<?php

declare(strict_types=1);

namespace App\Model;



/**
 * @property int $id 管理员操作记录ID
 * @property int $uid 管理员id
 * @property string $ip 登录IP
 * @property string $host 请求host
 * @property string $method 请求方式
 * @property string $url 链接
 * @property string $params 参数
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class SysUserLog extends Model
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'sys_user_log';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'ip', 'method', 'url', 'params', 'create_time'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer','params'=>'array','created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function user()
    {
        return $this->hasOne(SysUser::class, 'uid', 'uid');
    }
}
